public class sk4 {
    public static void main(String[] args) {
        int oldArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5};
        int num=0;
        for (int i:oldArr) {
            if (i!=0){
                num++;
            }
        }
        int newArr[]=new int[num];
        int j=0;
        for (int i:oldArr) {
            if (i!=0){
                newArr[j]=i;
                j++;
            }
        }
        for (int i:newArr) {
            System.out.print(i+" ");
        }
    }
}
